﻿using RestSharp;
using System.Text;
using Ymatou.ServiceCenter;

namespace Ymatou.User.Dto.Auth
{
    /// <summary>
    /// 校验签名
    /// </summary>
    [Resource("auth.ymatou.com", "/json/reply/SignAuthRequestDto", Method.GET, ParameterBuildType.UrlQueryString)]
    public class SignAuthRequestDto
    {
        /// <summary>
        /// sign
        /// </summary>
        public string Sign { get; set; }
        /// <summary>
        /// token
        /// </summary>
        public string Token { get; set; }
        /// <summary>
        /// 原始窜
        /// </summary>        
        public string OriginalVal { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 客户端Ip
        /// </summary>
        public string ClientIp { get; set; }
        /// <summary>
        /// 客户端类型
        /// </summary>
        public string sClientType { get; set; }
        /// <summary>
        /// 认证来源（Pc,App,Wap,SellerApp,SellerPc）
        /// </summary>
        public string TokenSource { get; set; }
        public string DeviceId { get; set; }

        public string RequestId { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(" SignAuthRequestDto Parameters: ");
            sb.AppendFormat("RequestId: {0}, ", RequestId);
            sb.AppendFormat("Sign: {0}, ", Sign);
            sb.AppendFormat("Token: {0}, ", Token);
            sb.AppendFormat("OriginalVal: {0}, ", OriginalVal);
            sb.AppendFormat("sClientType: {0}, ", sClientType);
            sb.AppendFormat("Description: {0}, ", Description);
            sb.AppendFormat("ClientIp: {0}, ", ClientIp);
            sb.AppendFormat("DeviceId: {0}, ", DeviceId);
            sb.AppendFormat("TokenSource: {0}", TokenSource);

            string str = sb.ToString();
            return str.Length > 1000 ? str.Substring(0, 1000) : str;
        }
    }
}
